Repository navigation
Set database client and JDBC span tags by id (tag registry rollout) - #13193
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 registered IDs match the existing database and JDBC tag keys and preserve setter overloads, null handling, and tag interception.
🤖 Bits Code Review · Commit 67bb80a
🟢 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. |
67bb80a to
d82541c
Compare
d983320 to
7e702ac
Compare
d82541c to
7ebc223
Compare
There was a problem hiding this comment.
The new collision policy rejects the existing shared plugin fixture, breaking build-plugin verification. The constant rename also silently narrows the bucket-hash checks to tags whose names still end in _ID.
🤖 Bits Code Review · Commit d82541c
Findings that could not be posted inline
build-logic/tag-registry/src/main/kotlin/datadog/buildlogic/tagRegistry/KnownTagsEmitter.kt:36
Adapt the shared plugin fixture to the new collision policy
TagRegistryGeneratorPluginTest's shared fixture still declares both foo and foo.name. These now claim FOO_NAME as a string constant and an ID respectively, causing generation to throw before the existing compilation, cache, and custom-output assertions. Update the shared fixture or provide a java_names override alongside this collision-policy change.
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
build-logic/tag-registry/src/main/kotlin/datadog/buildlogic/tagRegistry/KnownTagsEmitter.kt:47
Update bucket-hash ID enumeration for the removed suffix
TagMapBucketHashTest.knownTagIds() still selects reflected long fields whose names end in _ID. After this rename, it only includes tags whose names naturally have that suffix, silently excluding tags such as HTTP_METHOD and HTTP_ROUTE from the distinct-hash and slot-bucketing checks. Remove the suffix predicate in that helper to preserve coverage of all generated IDs.
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
DatabaseClientDecorator, which every database client's spans go through, and the JDBC instrumentation now set their tags with KnownTags ids instead of names. All of them were already registered; the "_dd.dbm_trace_injected" literal becomes the same id as its constant. JDBCDecorator's setTagIfPresent takes the id. 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>
7ebc223 to
08dac0f
Compare
There was a problem hiding this comment.
Renaming generated tag constants leaves the bucket-hash tests filtering by the old _ID suffix, silently excluding database and HTTP tags from their checks.
🤖 Bits Code Review · Commit 7ebc223
Findings that could not be posted inline
build-logic/tag-registry/src/main/kotlin/datadog/buildlogic/tagRegistry/KnownTagsEmitter.kt:47
Preserve full tag enumeration in the bucket-hash tests
After this rename, TagMapBucketHashTest.knownTagIds() still requires field names ending in "_ID", so it selects only 16 of 330 tags and omits every database and HTTP tag. The uniqueness and slot-placement checks therefore keep passing without exercising most of the registry. Update that helper to select static long fields independently of their names.
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
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
What Does This Do
Sets database span tags with
KnownTagsids instead of names, in two places:DatabaseClientDecorator, which every database client's spans go through (JDBC, Redis, Mongo, Cassandra, ...):db.user,peer.hostname,db.instance,db.type.db.operation,db.warehouse,db.schema,db.pool.name,component_dd.propagated_hash,_dd.dbm_trace_injected,_dd.instrumentation.time_msJDBCDecorator.setTagIfPresentnow takes the id. All of its callers passed constants."_dd.dbm_trace_injected"string literal becomes the same id as its constant.Motivation
This continues the move to ids after Kafka (#13192). Every one of these tags was already registered, so the change is mechanical. The decorator part benefits every database client, not just JDBC.
Additional Notes
setTag(String, …)resolves the name and callssetTag(long, …). This PR calls the id setter directly, so storage and interception are unchanged..withTag("dd.instrumentation", true)on the span builder. The builder has no id-keyedwithTagyet, anddd.instrumentationisn't registered.DB_POOL_NAME). It doesn't depend on Set Kafka span tags by id (tag registry rollout) #13192.setTagassertions, because the id default method delegates to the name.test: 328 pass. The other 100 areRemoteJDBCInstrumentationV0Test, which needs Docker (Testcontainers) and couldn't run locally. CI will cover them.🤖 Generated with Claude Code