Skip to content

feat: add dbm dynamic_service mode#18269

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
mainfrom
raphael/py_dbm
Jun 1, 2026
Merged

feat: add dbm dynamic_service mode#18269
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
mainfrom
raphael/py_dbm

Conversation

@raphaelgavache

@raphaelgavache raphaelgavache commented May 26, 2026

Copy link
Copy Markdown
Member

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.

(similar implem in dd-trace-java)

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).

Tested against this system-test
with

env TEST_LIBRARY=python ./run.sh DBM_DYNAMIC_SERVICE -F tests/integrations/test_dbm.py::Test_Dbm_DynamicService_Postgres tests/integrations/test_dbm.py::Test_Dbm_DynamicService_Postgres::test_dbm_dynamic_service

  └ ================================= test context =================================
    Scenario: DBM_DYNAMIC_SERVICE
    … +27 lines (ctrl + t to view transcript)
    - generated xml file: /Users/raphael.gavache/go/src/github.com/DataDog/system-tests/logs_dbm_dynamic_service/reportJunit.xml -
    ============================== 1 passed in 14.22s =============================
    ```

@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented May 26, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 8 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-py | build linux serverless: [amd64, cp315-cp315, v113741238-d2b8243-manylinux2014_x86_64, 1]   View in Datadog   GitLab

🛟 This job is unlikely to succeed on retry. Please review your pipeline configuration. NotImplementedError: This version of CPython is not supported yet

DataDog/apm-reliability/dd-trace-py | build linux serverless: [amd64, cp315-cp315, v113741491-d2b8243-musllinux_1_2_x86_64, 1]   View in Datadog   GitLab

🛟 This job is unlikely to succeed on retry. Please review your pipeline configuration. Incompatible Python interpreter version detected: Python 3.15.0b1 is not supported while the requirement is >=3.9, <3.15.

DataDog/apm-reliability/dd-trace-py | build linux serverless: [arm64, cp315-cp315, v113741357-d2b8243-manylinux2014_aarch64, 1]   View in Datadog   GitLab

🛟 This job is unlikely to succeed on retry. Please review your pipeline configuration. NotImplementedError: This version of CPython is not supported yet

View all 8 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog auto-retried 1 job - 1 passed on retry View in Datadog

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 3f001d8 | Docs | Datadog PR Page | Give us feedback!

@pr-commenter

pr-commenter Bot commented May 26, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-05-26 16:21:25

Comparing candidate commit f7bb6ed in PR branch raphael/py_dbm with baseline commit 519d69c in branch main.

Found 0 performance improvements and 3 performance regressions! Performance is the same for 615 metrics, 10 unstable metrics.

scenario:iastaspectsospath-ospathbasename_aspect

  • 🟥 execution_time [+93.349µs; +101.706µs] or [+21.620%; +23.556%]

scenario:span-start

  • 🟥 execution_time [+1.533ms; +1.694ms] or [+9.820%; +10.851%]

scenario:telemetryaddmetric-1-count-metric-1-times

  • 🟥 execution_time [+296.655ns; +332.111ns] or [+14.033%; +15.710%]

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Codeowners resolved as

ddtrace/internal/settings/_database_monitoring.py                       @DataDog/apm-core-python
ddtrace/propagation/_database_monitoring.py                             @DataDog/apm-sdk-capabilities-python
releasenotes/notes/add-dbm-dynamic-service-propagation-mode-5f0c2a8b7d1e.yaml  @DataDog/apm-python
tests/internal/test_database_monitoring.py                              @DataDog/apm-core-python

@raphaelgavache raphaelgavache marked this pull request as ready for review May 27, 2026 00:10
@raphaelgavache raphaelgavache requested review from a team as code owners May 27, 2026 00:10

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

Copy link
Copy Markdown

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: bcf58a4070

ℹ️ 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".

Comment thread ddtrace/propagation/_database_monitoring.py
@raphaelgavache raphaelgavache added the ai-generated PR created with AI assistance label May 27, 2026

@emmettbutler emmettbutler left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Release note looks good

@raphaelgavache

Copy link
Copy Markdown
Member Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented May 28, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-05-28 18:23:11 UTC ℹ️ Start processing command /merge


2026-05-28 18:23:16 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 56m (p90).


2026-05-28 20:23:55 UTCMergeQueue: The build pipeline has timeout

The merge request has been interrupted because the build 1760991991687689213 took longer than expected. The current limit for the base branch 'main' is 120 minutes.

@raphaelgavache

Copy link
Copy Markdown
Member Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented May 28, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-05-28 20:36:02 UTC ℹ️ Start processing command /merge


2026-05-28 20:36:07 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 56m (p90).


2026-05-28 22:36:31 UTCMergeQueue: The build pipeline has timeout

The merge request has been interrupted because the build 466003051541639579 took longer than expected. The current limit for the base branch 'main' is 120 minutes.

@raphaelgavache

Copy link
Copy Markdown
Member Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jun 1, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-06-01 22:08:31 UTC ℹ️ Start processing command /merge


2026-06-01 22:08:36 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 51m (p90).


2026-06-01 22:40:44 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit e92c957 into main Jun 1, 2026
1025 of 1027 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the raphael/py_dbm branch June 1, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated PR created with AI assistance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants