-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[exporter/elasticsearch] Ability to specify the document ID for logs #36882
Labels
Comments
mauri870
added
enhancement
New feature or request
needs triage
New item requiring triage
labels
Dec 18, 2024
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
mauri870
changed the title
[exporter/elasticsearch] Ability to specify the document ID
[exporter/elasticsearch] Ability to specify the document ID for logs
Dec 18, 2024
This sounds like a valid enhancement to me. Let's see what the code owners have to say about this. |
VihasMakwana
added
waiting-for-code-owners
and removed
needs triage
New item requiring triage
labels
Dec 18, 2024
This was referenced Dec 24, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Component(s)
exporter/elasticsearch
Is your feature request related to a problem? Please describe.
In Beats we are using the bodymap mapping mode to control the final document structure for logs. There is one thing we are unable to control with this approach, the final document ID. We use to control this ID for means of deduplicating messages as well as setting the id from a log field. For context, see https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-deduplication.html.
Describe the solution you'd like
We would like to have a way to tell the exporter to use a specific ID as the document identifier. The current implementation does not allow this and defaults to an autogenerated ID here. This might be a broader question for the collector in general, as we would like such functionality to be available from all the exporters.
Describe alternatives you've considered
One alternative is to consider a specific field in the log message body as the document id. For example in beats we use
@metatada._id
as the ID field, this@metadata
field is then stripped out at our output layer (equivalent to an exporter in OTel) so we can use this information to set the ID properly in the final document.Looking at the Logs model for OTel this would be equivalent to an Attribute. I imagine deduplication and the ability to set an identifier for the exported data is an interesting functionality that perhaps shoudn't be constrained to the elasticsearchexporter so I'm open to more general suggestions.
Additional context
No response
The text was updated successfully, but these errors were encountered: