Use TagExtractor for JDBC connection-info tags (canary)#11820
Draft
dougqh wants to merge 2 commits into
Draft
Conversation
|
🎯 Code Coverage (details) 🔗 Commit SHA: 56d280d | Docs | Datadog PR Page | Give us feedback! |
Contributor
🟢 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. |
First real use of the TagExtractor mechanism: lifts the pure field->tag connection tags (warehouse / schema / pool) out of JDBCDecorator into a static-final non-capturing CONNECTION_INFO_EXTRACTOR, applied via the span-first span.setTags(dbInfo, CONNECTION_INFO_EXTRACTOR) at the single onConnection site (a monomorphic call site the JIT inlines). Behavior- identical to the previous inline setTagIfPresent block. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0cf3f5d to
ccc7e0d
Compare
Turns the inline lambda into ConnectionInfoExtractor (a proper TagExtractor<DBInfo> with a private-ctor INSTANCE singleton), mirroring PeerConnectionExtractor. Gives it a name at the call site (span.setTags(dbInfo, ConnectionInfoExtractor.INSTANCE)) and makes it composable. The setTagIfPresent helper moves onto the class. Verified auto-injected as a transitive helper (JDBCInstrumentationV0Test: 87/87 green) — no manual helperClassNames() entry needed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 1, 2026
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.
Draft — stacked on #11817 (the
TagContributor/TagExtractorAPI). First real use of the API; the canary for dissolving the decorators.Lifts
JDBCDecorator's JDBC-specific pure field→tag connection tags (db.warehouse/db.schema/db.pool.name— thesetTagIfPresentblock inonConnection) intoConnectionInfoExtractor, a named singletonTagExtractor<DBInfo>, applied via the span-firstspan.setTags(dbInfo, ConnectionInfoExtractor.INSTANCE)at the singleonConnectionsite (monomorphic → the JIT inlines it). Behavior-identical: the extractor makes the same threesetTagIfPresentcalls via the same helper (now on the extractor class).Scope (deliberately minimal)
Bucket-(b) pure extraction only, JDBC-only, no shared-base change.
DB_TYPE/ user / instance / hostname stay in the decorator —db.usermoves in #11823; instance/hostname feed service-name derivation, which awaits the declarative-derivation step.Perf
Perf-neutral by construction — the tags moved here were already direct
setTagIfPresentcalls (not the megamorphic template-method dispatches), and the extractor is monomorphic → inlines → same code as before. The dispatch-reduction win (N→1) lives in the template methods (dbUser/dbInstance/dbHostname), addressed in the stacked peels. See the syntheticTagProjectionBenchmarkin #11817 for the mechanism.Validation
JDBCInstrumentationV0Testgreen (87/87, incl. thedb.warehouse/db.schema/db.pool.nameassertions). Notably,ConnectionInfoExtractor— a separate top-level helper class (the old lambda used to compile intoJDBCDecorator) — is auto-injected via transitive helper collection with nohelperClassNames()edit. (RemoteJDBC*tests are postgres/mysql/sqlserver testcontainers — env-gated, CI-only.)🤖 Generated with Claude Code