Repository navigation
Set Kafka span tags by id (tag registry rollout) - #13192
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
More details
The Kafka tag IDs match the original tag names and preserve overload selection, tag interception, and fallback behavior for non-core spans.
🤖 Bits Code Review · Commit 17e2fea
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
17e2fea to
20319a0
Compare
d983320 to
7e702ac
Compare
20319a0 to
6af5cb4
Compare
There was a problem hiding this comment.
The new constant-collision rule rejects the existing foo/foo.name fixture, preventing Gradle plugin compilation and cache tests from reaching their assertions.
🤖 Bits Code Review · Commit 20319a0
Findings that could not be posted inline
build-logic/tag-registry/src/main/kotlin/datadog/buildlogic/tagRegistry/KnownTagsEmitter.kt:47
Update the plugin-test fixture for the new collision rule
The existing TagRegistryGeneratorPluginTest shared fixture declares both foo and foo.name without an overlay. These claims assign FOO_NAME to both foo's string constant and foo.name's ID, causing generation to throw instead of succeeding. Compilation, caching, and custom-output tests consequently fail before their assertions. Rename a fixture tag or configure a java_names overlay in the shared fixture.
React: 👍 useful · 👎 wrong · 😕 unclear · 👀 right, but not acting on it
What each reaction means
- 👍 Useful: correct, and you're fixing it or will.
- 👎 Wrong: the finding is incorrect, for example the bug can't happen or the code was misread.
- 😕 Unclear: you can't tell what it means or why it matters.
- 👀 Right, not acting: correct, but intended, out of scope for this PR, a known risk, or too minor.
🤖 Bits Code Review · Open Bits AI session
Kafka's producer, consumer and Streams spans now set their tags with KnownTags ids instead of names, skipping the name lookup on every set. All of them were already registered (the kafka mixin, plus kafka.records_count and record.queue_time_ms), so this is a mechanical swap; the core span stores and intercepts an id exactly as it did the name it resolved to. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#13061 now names an id after its tag with no _ID suffix. Rename only; the ids are the same values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6af5cb4 to
197a624
Compare
There was a problem hiding this comment.
More details
The Kafka ID setters preserve existing tag names and setter overloads, and the stacked generator’s constant renames are consistently reflected in callers.
🤖 Bits Code Review · Commit 6af5cb4
|
/merge |
|
View all feedbacks in Devflow UI.
It will be processed automatically as soon as GitHub reports it as mergeable. View in MergeQueue UI.
The expected merge time in
|
What Does This Do
Kafka's producer, consumer and Streams spans now set their tags with
KnownTagsids instead of names. That's 35 call sites inkafka-clients-0.11,kafka-clients-3.8andkafka-streams-0.11.InstrumentationTags,String)KnownTagsid,long)partition/offsetPARTITION/OFFSETPARTITION/OFFSETmessaging.destination.nameMESSAGING_DESTINATION_NAMEMESSAGING_DESTINATION_NAMEkafka.groupCONSUMER_GROUPKAFKA_GROUPmessaging.kafka.cluster.idKAFKA_CLUSTER_IDMESSAGING_KAFKA_CLUSTER_IDmessaging.kafka.bootstrap.serversKAFKA_BOOTSTRAP_SERVERSMESSAGING_KAFKA_BOOTSTRAP_SERVERSrecord.queue_time_ms,kafka.records_count,tombstone,processor.nameInstrumentationTags.*KnownTags.*, same nameMany ids have the same simple name as the string constant they replace. The static import is what changes, from
InstrumentationTagstoKnownTags.Motivation
This is the first instrumentation moved onto ids. Every Kafka tag was already registered (the
kafkamixin, pluskafka.records_countandrecord.queue_time_ms), so the port is a mechanical swap. Setting by id skips the name-to-id lookup thatsetTag(String, …)does on every call.Additional Notes
setTag(String, …)resolves the name and callssetTag(long, …). This PR calls the id setter directly, so storage and interception are unchanged. Non-core spans fall back to the name through the default method.ProducerRecord.partition()is a boxedInteger, so it still resolves to theObjectoverload, as it did with aStringkey.setTag(long, …)is a default instance method onAgentSpan, not a static interface method, and the ids are compile-time constants that get inlined.MESSAGING_KAFKA_CLUSTER_ID).kafka-clients-0.11:test,forkedTest,latestDepTestandlatestDepForkedTestpass (125 tests).kafka-clients-3.8:testpasses (23 tests).kafka-streams-0.11latestDepTestfails with 7 traces where it expects 3, because of extrakafka.polltraces. It fails the same way on the base branch without this change, so it's pre-existing. The tags on its spans are correct.🤖 Generated with Claude Code