Skip to content

Add a new dynamic_service DBM propagation mode#11432

Open
amarziali wants to merge 2 commits into
masterfrom
andrea.marziali/dbm-dynamic-service
Open

Add a new dynamic_service DBM propagation mode#11432
amarziali wants to merge 2 commits into
masterfrom
andrea.marziali/dbm-dynamic-service

Conversation

@amarziali
Copy link
Copy Markdown
Contributor

@amarziali amarziali commented May 21, 2026

What Does This Do

Introduces a new DD_DBM_PROPAGATION_MODE=dynamic_service value that combines service mode behaviour with automatic SQL base hash injection, without requiring users to separately set DD_DBM_INJECT_SQL_BASEHASH=true.

Setting dynamic_service is equivalent to:

DD_DBM_PROPAGATION_MODE=service
DD_DBM_INJECT_SQL_BASEHASH=true

Like service mode, dynamic_service injects service metadata tags (ddps, dddbs, ddh, dddb, dde, ddpv) and the base hash tag (ddsh) into comments. It does not inject traceparent (that remains exclusive to full mode).

Also removed unnecessary process tags injectSysConfig in tests

Motivation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

Note: Once your PR is ready to merge, add it to the merge queue by commenting /merge. /merge -c cancels 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.

@amarziali amarziali added type: enhancement Enhancements and improvements comp: database Database Monitoring labels May 21, 2026
@amarziali amarziali requested a review from raphaelgavache May 21, 2026 08:52
@amarziali amarziali force-pushed the andrea.marziali/dbm-dynamic-service branch from 16a91e7 to 73656ad Compare May 21, 2026 08:56
@datadog-official

This comment has been minimized.

@amarziali amarziali marked this pull request as ready for review May 21, 2026 10:16
@amarziali amarziali requested review from a team as code owners May 21, 2026 10:16
@amarziali amarziali requested review from ValentinZakharov, Copilot and dougqh and removed request for a team May 21, 2026 10:16
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_service as a DBM propagation mode and treated it as comment-injection enabled.
  • Made dynamic_service implicitly enable isDbmInjectSqlBaseHash().
  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: database Database Monitoring type: enhancement Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants