8000 Kafka Exporter by rjenkins · Pull Request #131 · streamfold/rotel · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Kafka Exporter #131

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

Merged
merged 26 commits into from
Jul 3, 2025
Merged

Kafka Exporter #131

merged 26 commits into from
Jul 3, 2025

Conversation

rjenkins
Copy link
Contributor
@rjenkins rjenkins commented Jun 29, 2025

Completes: STR-3448
Closes: #122

Adds support for the Kafka exporter. We're currently marking experimental. On the configuration side we have exposed all of the most important and high priority configuration parameters as marked https://docs.confluent.io/platform/current/clients/librdkafka/html/md_CONFIGURATION.html#autotoc_md93 and tried to maintain parity with the reference collector.

Additionally the user can set and override any librdkafka option using the kafka_exporter_custom_config option, exposing all potential options.

There is a significant amount of test coverage and in addition to unit tests this PR features integration tests, which are placed behind a feature flag. The integration test covers advanced functionality including message key based partitioning to verify the partition by resource attributes features for metrics and logs are spread consistently and randomly across Kafka partitions.

There's a few other things we'll want to follow up with.

  1. Kafka headers from grpc metadata, user request here: Kafka exporter #122 (comment). This is currently blocked on the fact that we strip off grpc metadata before OTLP data is sent down the pipeline.
  2. Some features like topic_from_metadata_key topic_from_attribute. We should investigate how important these are before implementing
  3. internal telemetry support (counters for errors and successful sends)
  4. Partitioning by trace_id. Took a stab at that in this PR but ran into what looked like a memory leak. It may just be that the loadtesting resulted in a cardinality explosion as each span had a unique trace_id. However we should be able to handle that better than eating up a lot of RAM. It is possible we just spun up too many native os threads for the encoding routines or alternatively we're hitting some throughput bottleneck and applied backpressure to the pipeline whose queue filled up. Either way that feature was removed from this PR but we will follow up after digging in.
  5. Moving Kafka producer sends behind a Tower service. The Kafka producer can block or return an error when its internal queue is full. Ideally we will track this behind a tower service and expose that via the poll_ready API to signal backpressure to the pipeline. We need to spend further time investigating the best tokio patterns for working with rdkafka.

In terms of throughput and resource utilization, values are inline with current exporters and we don't see any crazy high amounts of resources or diminished throughput when testing with loadtester at high volumes.. e.g 400K span/sec etc.

10000

@rjenkins rjenkins marked this pull request as ready for review July 2, 2025 19:13
@rjenkins rjenkins requested a review from mheffner July 2, 2025 19:14
@rjenkins
Copy link
Contributor Author
rjenkins commented Jul 2, 2025

Completes: STR-3448
Closes: #122

Copy link
Contributor
@mheffner mheffner left a comment

Choose a reason for hiding this comment

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

Fantastic work on this, I love the breadth of feature support. Some comments throughout, but I think the big ones are mostly around handling the new multiple exporter cases. I'm happy to help on supporting that if need be.

Copy link
Contributor
@mheffner mheffner left a comment

Choose a reason for hiding this comment

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

Just needs the small doc fix I think, but 👍

README.md Outdated
| --kafka-exporter-traces-topic | otlp_traces | |
| --kafka-exporter-metrics-topic | otlp_metrics | |
| --kafka-exporter-logs-topic | otlp_logs | |
| --kafka-exporter-format | json | json, protobuf |
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be protobuf now?

@rjenkins rjenkins merged commit fdcf52c into main Jul 3, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kafka exporter
2 participants
0