feat(aiokafka): add partition and offset to produce span#18344
Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit intoJun 2, 2026
Merged
Conversation
Codeowners resolved as |
This comment has been minimized.
This comment has been minimized.
BenchmarksBenchmark execution time: 2026-05-29 20:21:09 Comparing candidate commit 3d175fe in PR branch Found 0 performance improvements and 2 performance regressions! Performance is the same for 383 metrics, 9 unstable metrics. scenario:span-start
scenario:telemetryaddmetric-1-count-metric-1-times
|
After the broker acknowledges a send, set the producer span's kafka.partition and kafka.message_offset to the values from the resulting RecordMetadata. The partition reflects what the broker actually assigned, which may differ from any partition hint the caller passed. Mirrors the equivalent change in dd-trace-java#11107. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
37b9529 to
3d175fe
Compare
chnn
approved these changes
Jun 1, 2026
juanjux
approved these changes
Jun 1, 2026
quinna-h
approved these changes
Jun 2, 2026
f7a3f18
into
main
1253 of 1255 checks passed
brettlangdon
pushed a commit
that referenced
this pull request
Jun 3, 2026
## Summary - After the broker acknowledges a send, populate `kafka.partition` and `kafka.message_offset` on the producer span from the resulting `RecordMetadata`. - The partition tag now reflects the partition the broker actually assigned, which may differ from any hint the caller passed via `send(..., partition=...)`. - Mirrors the equivalent feature added to the Java tracer in DataDog/dd-trace-java#11107. ## Test plan - [x] Verified locally: aiokafka produce snapshots now carry `kafka.partition: 0` / `kafka.message_offset: 0` instead of `-1` for first-message produces. - [ ] CI: aiokafka contrib suites. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: piotr.wolski <piotr.wolski@datadoghq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
kafka.partitionandkafka.message_offseton the producer span from the resultingRecordMetadata.send(..., partition=...).Test plan
kafka.partition: 0/kafka.message_offset: 0instead of-1for first-message produces.🤖 Generated with Claude Code