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

[kafkareceiver] - dynamic metadata support #21729

Closed
VihasMakwana opened this issue May 10, 2023 · 13 comments
Closed

[kafkareceiver] - dynamic metadata support #21729

VihasMakwana opened this issue May 10, 2023 · 13 comments
Assignees
Labels
enhancement New feature or request receiver/kafka

Comments

@VihasMakwana
Copy link
Contributor

Component(s)

receiver/kafka

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

It's an enhancement request

Describe the solution you'd like

Users can specify custom metadata fields in Kafka message headers.
Currently, kafkareceiver receives the log, unmarshals it, and passes it forward.
It ignores the header field.
Users might want to attach metadata in headers and use that data in later stages.

Instead of ignoring the headers, we can also pass them on to the next stage.

Describe alternatives you've considered

Open for any other alternatives

Additional context

No response

@VihasMakwana VihasMakwana added enhancement New feature or request needs triage New item requiring triage labels May 10, 2023
@github-actions
Copy link
Contributor

Pinging code owners:

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

@atoulme atoulme added receiver/kafka and removed needs triage New item requiring triage labels May 10, 2023
@github-actions
Copy link
Contributor

Pinging code owners for receiver/kafka: @pavolloffay @MovieStoreGuy. See Adding Labels via Comments if you do not have permissions to add labels yourself.

@MovieStoreGuy
Copy link
Contributor

Do you have an example of how you would use the headers from kafka as part of the data that is sent?

@VihasMakwana
Copy link
Contributor Author

Yes, I would like to give you an example using Splunk Exporter:

Let's suppose I send the following event:
Event content: {"key": "value"}
Header: {"index": "main", "source": "custom"}

I eventually want this data to send in "main" index on Splunk.
I can't do this as the current implementation ignores the kafka headers and only forwards the event.
If I have the header data, I would use some processors to parse that data in the later stage of the pipeline.

This was just an example from my pov, there might be others as well.

@MovieStoreGuy
Copy link
Contributor

Unfortunately the collector doesn't have a current mechanism to pass meta information from one receiver to another that can associate it with data (interestingly enough considering that this is tracing's jam).

While it is possible to extract those headers for you, it is another request to have components consume that meta information that could be provided to those components.

@VihasMakwana
Copy link
Contributor Author

While it is possible to extract those headers for you, it is another request to have components consume that meta information that could be provided to those components.

Yeah, I agree. I can actually create a PR myself if you're open to taking a look. I'll think this through one more time.
I just want kafkareceiver to attach the header metadata and I can find a way by myself to use them.
We can mark this as optional in the configuration.

@VihasMakwana
Copy link
Contributor Author

@MovieStoreGuy ^^

@MovieStoreGuy
Copy link
Contributor

MovieStoreGuy commented May 18, 2023

I am happy to review, but depending how much it touch will require some further conversation if we want to accept it upstream. If you have the time to create a PR as a PoC of what could happen, I would be interested to see.

Unfortunately, I don't have the time to spike this myself.

@VihasMakwana
Copy link
Contributor Author

Yeah, no worries, I planned working on this before creating the issue, so no issues there.

If you cna assign this to me.

@github-actions
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.

@github-actions github-actions bot added the Stale label Jul 21, 2023
@github-actions
Copy link
Contributor

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2023
@VihasMakwana
Copy link
Contributor Author

@MovieStoreGuy can you reopen this in any way? I can't see any button.
Also, can you take a look at the PR. i think it looks good

@MovieStoreGuy MovieStoreGuy reopened this Sep 19, 2023
evan-bradley pushed a commit that referenced this issue Sep 29, 2023
**Description:** Enable support to extract headers from Kafka Messages
and attach them to resource attributes. In later stages in the pipeline,
different exporters can utilize this information.

**Link to tracking Issue:**
[21729](#21729)

**Testing:** Added test cases for logs, traces, and metrics.

**Documentation:** <Describe the documentation added.>

---------

Co-authored-by: Alex Boten <aboten@lightstep.com>
@VihasMakwana
Copy link
Contributor Author

Completed via #24367

jmsnll pushed a commit to jmsnll/opentelemetry-collector-contrib that referenced this issue Nov 12, 2023
**Description:** Enable support to extract headers from Kafka Messages
and attach them to resource attributes. In later stages in the pipeline,
different exporters can utilize this information.

**Link to tracking Issue:**
[21729](open-telemetry#21729)

**Testing:** Added test cases for logs, traces, and metrics.

**Documentation:** <Describe the documentation added.>

---------

Co-authored-by: Alex Boten <aboten@lightstep.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request receiver/kafka
Projects
None yet
Development

No branches or pull requests

3 participants