Add a new dynamic_service DBM propagation mode#11432
Conversation
16a91e7 to
73656ad
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65972690c8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds a new DBM propagation mode (dynamic_service) that behaves like service mode for comment injection while automatically enabling SQL base-hash injection (without requiring DD_DBM_INJECT_SQL_BASEHASH=true). This extends the DBM comment-injection configuration surface in Config and ensures JDBC instrumentation recognizes the new mode, with targeted forked tests verifying behavior.
Changes:
- Introduced
dynamic_serviceas a DBM propagation mode and treated it as comment-injection enabled. - Made
dynamic_serviceimplicitly enableisDbmInjectSqlBaseHash(). - Added JDBC forked tests for
dynamic_service(no trace context injection; base-hash is injected) and removed an unnecessary process-tags sysconfig toggle from existing tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal-api/src/main/java/datadog/trace/api/Config.java | Adds dynamic_service constant; enables comment injection and base-hash injection when selected. |
| dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/JDBCDecorator.java | Treats dynamic_service as comment-injection enabled (no trace context injection unless full). |
| dd-java-agent/instrumentation/jdbc/src/test/groovy/JDBCDecoratorTest.groovy | Adds forked test asserting dynamic_service does not inject trace context. |
| dd-java-agent/instrumentation/jdbc/src/test/groovy/DBMInjectionForkedTest.groovy | Adds forked test asserting dynamic_service injects base hash but not traceparent; removes unnecessary sysconfig in base-hash test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What Does This Do
Introduces a new
DD_DBM_PROPAGATION_MODE=dynamic_servicevalue that combinesservicemode behaviour with automatic SQL base hash injection, without requiring users to separately setDD_DBM_INJECT_SQL_BASEHASH=true.Setting
dynamic_serviceis equivalent to:Like
servicemode,dynamic_serviceinjects service metadata tags (ddps,dddbs,ddh,dddb,dde,ddpv) and the base hash tag (ddsh) into comments. It does not injecttraceparent(that remains exclusive tofullmode).Also removed unnecessary process tags injectSysConfig in tests
Motivation
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]
Note: Once your PR is ready to merge, add it to the merge queue by commenting
/merge./merge -ccancels the queue request./merge -f --reason "reason"skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.