Skip to content
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

[receiver/kafka]: Support access to message key #35231

Open
SoerenHenning opened this issue Sep 17, 2024 · 4 comments
Open

[receiver/kafka]: Support access to message key #35231

SoerenHenning opened this issue Sep 17, 2024 · 4 comments

Comments

@SoerenHenning
Copy link

SoerenHenning commented Sep 17, 2024

Component(s)

receiver/kafka

Is your feature request related to a problem? Please describe.

It looks like there is currently no way to access the key of a Kafka message. This feature would be quite helpful as it is a common pattern to carry non-redundant data in the key and this data should also be exported to an OTel backend. Note that exporting message headers is already supported.

Describe the solution you'd like

The easiest solution would probably be to extract the key and add it to the resource attributes, just like it is already possible with headers. I propose adding the following configuration:

  • key_extraction (default = false): Allows user to attach the message key to resource attributes in otel piepline

Describe alternatives you've considered

Alternatively, the key could also be added somehow to the body of a log record, but the specific implementation would depend on the encoding. I am therefore much more in favor of adding the key to the resource attributes.

Additional context

No response

@SoerenHenning SoerenHenning added enhancement New feature or request needs triage New item requiring triage labels Sep 17, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@SoerenHenning
Copy link
Author

I still think this is a relevant feature for productive usage of the Kafka receiver.

@atoulme
Copy link
Contributor

atoulme commented Dec 7, 2024

@pavolloffay @MovieStoreGuy please weigh in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants