Honor OTLP log document metadata#147799
Conversation
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
|
Hi @felixbarny, I've created a changelog YAML for you. |
🔍 Preview links for changed docs⏳ Building and deploying preview... View progress This comment will be updated with preview links when the build is complete. |
ℹ️ Important: Docs version tagging👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version. We use applies_to tags to mark version-specific features and changes. Expand for a quick overviewWhen to use applies_to tags:✅ At the page level to indicate which products/deployments the content applies to (mandatory) What NOT to do:❌ Don't remove or replace information that applies to an older version 🤔 Need help?
|
| /** | ||
| * Elastic-specific OTLP attributes that configure per-document indexing metadata. | ||
| */ | ||
| public final class DocumentMetadata { |
There was a problem hiding this comment.
I'm not sure there’s much value in putting those functions in a standalone class, since they aren't useful outside the OTLPLogsTransportAction context. I actually prefer local extractDocumentId.
There was a problem hiding this comment.
The span doc builder also supports the document_id, which is why I think the shared helper makes sense.
Summary
elasticsearch.document_idfor OTLP logs by applying it to the index request id.elasticsearch.ingest_pipelinefor OTLP logs by applying it as the index request pipeline.Test plan
./gradlew :x-pack:plugin:otel-data:test --tests "org.elasticsearch.xpack.oteldata.otlp.OTLPLogsTransportActionTests"./gradlew :x-pack:plugin:otel-data:test --tests "org.elasticsearch.xpack.oteldata.otlp.OTLPLogsTransportActionTests" --tests "org.elasticsearch.xpack.oteldata.otlp.OTLPTracesTransportActionTests"./gradlew :x-pack:plugin:otel-data:test --tests "org.elasticsearch.xpack.oteldata.otlp.OTLPLogsTransportActionTests" --tests "org.elasticsearch.xpack.oteldata.otlp.docbuilder.LogDocumentBuilderTests"./gradlew :x-pack:plugin:otel-data:spotlessJavaCheck