Skip to content

Conversation

@OhJuhun
Copy link
Contributor

@OhJuhun OhJuhun commented Sep 28, 2025

Description

Added log partitioning capability to the Kafka Exporter. When the partition_logs_by_trace_id option is enabled, log records are distributed to Kafka partitions based on their TraceID. Records without a TraceID fall back to the default partitioning strategy. If partition_logs_by_resource_attributes is also enabled, resource attribute partitioning takes precedence over TraceID partitioning.

Link to tracking issue

Fixes #39146

Testing

  • Added unit tests to validate TraceID-based log partitioning and option precedence logic.
  • Verified correct partitioning for various combinations of TraceIDs and resource attributes.

Documentation

  • Updated exporter/kafkaexporter/README.md with usage details and examples for partition_logs_by_trace_id.
  • Included related changelog updates.

Copy link
Contributor

@axw axw left a comment

Choose a reason for hiding this comment

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

Thanks for opening the PR @OhJuhun!

Copy link
Contributor

@axw axw left a comment

Choose a reason for hiding this comment

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

Thanks for the updates @OhJuhun. Looks good, just a few more minor comments.

Copy link
Contributor

@axw axw left a comment

Choose a reason for hiding this comment

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

Thanks for iterating on this @OhJuhun, looks great! Please fix the CI failures and then it's good to go :)

@OhJuhun
Copy link
Contributor Author

OhJuhun commented Oct 10, 2025

@axw thank you for your help and review!

@axw axw added ready to merge Code review completed; ready to merge by maintainers and removed waiting-for-code-owners labels Oct 13, 2025
@atoulme atoulme merged commit 21e7450 into open-telemetry:main Oct 13, 2025
186 checks passed
@github-actions github-actions bot added this to the next release milestone Oct 13, 2025
@otelbot
Copy link
Contributor

otelbot bot commented Oct 13, 2025

Thank you for your contribution @OhJuhun! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. If you are getting started contributing, you can also join the CNCF Slack channel #opentelemetry-new-contributors to ask for guidance and get help.

@OhJuhun
Copy link
Contributor Author

OhJuhun commented Oct 13, 2025

/easycla

ChrsMark pushed a commit to ChrsMark/opentelemetry-collector-contrib that referenced this pull request Oct 20, 2025
### Description
Added log partitioning capability to the Kafka Exporter. When the
`partition_logs_by_trace_id` option is enabled, log records are
distributed to Kafka partitions based on their TraceID. Records without
a TraceID fall back to the default partitioning strategy. If
`partition_logs_by_resource_attributes` is also enabled, resource
attribute partitioning takes precedence over TraceID partitioning.

### Link to tracking issue
Fixes open-telemetry#39146

### Testing
- Added unit tests to validate TraceID-based log partitioning and option
precedence logic.
- Verified correct partitioning for various combinations of TraceIDs and
resource attributes.

### Documentation
- Updated `exporter/kafkaexporter/README.md` with usage details and
examples for `partition_logs_by_trace_id`.
- Included related changelog updates.

---------

Co-authored-by: Andrew Wilkins <axwalk@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exporter/kafka ready to merge Code review completed; ready to merge by maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Partition Log Records by TraceID

4 participants