Skip to content

Honor OTLP log document metadata#147799

Merged
felixbarny merged 7 commits into
elastic:mainfrom
felixbarny:otlp-logs-follow-ups
Apr 30, 2026
Merged

Honor OTLP log document metadata#147799
felixbarny merged 7 commits into
elastic:mainfrom
felixbarny:otlp-logs-follow-ups

Conversation

@felixbarny
Copy link
Copy Markdown
Member

Summary

  • Honor elasticsearch.document_id for OTLP logs by applying it to the index request id.
  • Honor elasticsearch.ingest_pipeline for OTLP logs by applying it as the index request pipeline.
  • Treat both attributes as document metadata so they are not serialized into OTLP log documents.

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

@felixbarny felixbarny requested a review from a team as a code owner April 29, 2026 08:45
@felixbarny felixbarny self-assigned this Apr 29, 2026
@felixbarny felixbarny requested review from kkrik-es and sidosera April 29, 2026 08:45
@elasticsearchmachine elasticsearchmachine added Team:StorageEngine external-contributor Pull request authored by a developer outside the Elasticsearch team labels Apr 29, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Hi @felixbarny, I've created a changelog YAML for you.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Preview links for changed docs

⏳ Building and deploying preview... View progress

This comment will be updated with preview links when the build is complete.

@github-actions
Copy link
Copy Markdown
Contributor

ℹ️ 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 overview

When to use applies_to tags:

✅ At the page level to indicate which products/deployments the content applies to (mandatory)
✅ When features change state (e.g. preview, ga) in a specific version
✅ When availability differs across deployments and environments

What NOT to do:

❌ Don't remove or replace information that applies to an older version
❌ Don't add new information that applies to a specific version without an applies_to tag
❌ Don't forget that applies_to tags can be used at the page, section, and inline level

🤔 Need help?

@felixbarny felixbarny added :StorageEngine/Logs You know, for Logs and removed :StorageEngine/TSDB You know, for Metrics labels Apr 29, 2026
Co-authored-by: Serge S <SERGEY.IVANOVICH.SIDOROV@gmail.com>
/**
* Elastic-specific OTLP attributes that configure per-document indexing metadata.
*/
public final class DocumentMetadata {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The span doc builder also supports the document_id, which is why I think the shared helper makes sense.

@felixbarny felixbarny enabled auto-merge (squash) April 29, 2026 13:05
@felixbarny felixbarny merged commit 78512d8 into elastic:main Apr 30, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor Pull request authored by a developer outside the Elasticsearch team >non-issue :StorageEngine/Logs You know, for Logs Team:StorageEngine v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants