Skip to content

exporter/kafka: add support for defining topic as request metadata #39208

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

Closed
axw opened this issue Apr 7, 2025 · 4 comments · Fixed by #40154
Closed

exporter/kafka: add support for defining topic as request metadata #39208

axw opened this issue Apr 7, 2025 · 4 comments · Fixed by #40154
Labels
enhancement New feature or request exporter/kafka

Comments

@axw
Copy link
Contributor

axw commented Apr 7, 2025

Component(s)

exporter/kafka

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

We have a need to route in tenant-specific Kafka topics, similar to the approach described at https://kafka.apache.org/documentation/#multitenancy-topic-naming.

There are arbitrarily many ways one might want to route data, and these apply to other components, so this is best left to another component -- see #39199 for a proposal. That proposal involves injecting the topic name into request metadata, which can then be referenced by the Kafka exporter.

Describe the solution you'd like

As described in #38888 (comment), I would like to introduce a configuration setting for extracting the topic name from request metadata.

Concretely, we should build on #39204 and introduce additional signal-specific topic_from_metadata settings (alternative name welcome).

Describe alternatives you've considered

Originally I thought of making the topic name templated, as described in #38888.

Additional context

No response

@axw axw added enhancement New feature or request needs triage New item requiring triage labels Apr 7, 2025
Copy link
Contributor

github-actions bot commented Apr 7, 2025

Pinging code owners:

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

@crobert-1
Copy link
Member

Issue filed by code owner, removing needs triage

@axw
Copy link
Contributor Author

axw commented May 20, 2025

I've separated the message key support into #40149

@axw axw changed the title exporter/kafka: add support for defining topic and message key as request metadata exporter/kafka: add support for defining topic as request metadata May 20, 2025
@marclop
Copy link
Contributor

marclop commented May 20, 2025

I'll work on this issue to implement it as described.

marclop added a commit to marclop/opentelemetry-collector-contrib that referenced this issue May 20, 2025
Introduces a new per-signal config option `topic_from_metadata_key` to
allow the user to produce to topics which which can be set using parts
of the request metadata. This is useful for multi-tenant use-cases.

Closes open-telemetry#39208

Signed-off-by: Marc Lopez Rubio <[email protected]>
dragonlord93 pushed a commit to dragonlord93/opentelemetry-collector-contrib that referenced this issue May 23, 2025
#### Description
Introduces a new per-signal config option `topic_from_metadata_key` to
allow the user to produce to topics which which can be set using parts
of the request metadata. This is useful for multi-tenant use-cases.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Closes open-telemetry#39208

<!--Describe what testing was performed and which tests were added.-->
#### Testing

Unit tests

<!--Describe the documentation added.-->
#### Documentation

Updated the readme with the new option.

---------

Signed-off-by: Marc Lopez Rubio <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request exporter/kafka
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants