Skip to content

Propagate Oracle dynamic service hash without SQL comments - #12234

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
masterfrom
joel.marcotte/sdbm-2904-oracle-action-propagation
Sep 14, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
masterfrom
joel.marcotte/sdbm-2904-oracle-action-propagation

Conversation

@joelmarcotte

@joelmarcotte joelmarcotte commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • Add opt-in DD_DBM_PROPAGATION_ORACLE_ACTION_ONLY_ENABLED configuration. It defaults to false.
  • With DD_DBM_PROPAGATION_MODE=dynamic_service, write _DD_DDSH:<BaseHash> through setClientInfo("OCSID.ACTION", ...) for Oracle connections.
  • Suppress Oracle SQL-comment injection in that opt-in mode, including prepared-statement preparation.
  • Track the last attempted ACTION per physical connection. Set it once for a stable hash and refresh it only if the base hash changes.
  • Keep parsed URL metadata cached while cloning it before connection attachment so connection-local ACTION state cannot leak between connections with the same URL.
  • Preserve full mode, service mode, and dynamic-service SQL comments for other databases.

Why

SDBM-2904 requires Oracle DBM/APM correlation without changing statement text. Oracle SQL Plan Management matches exact SQL text, so injected comments can prevent stored baselines from matching.

The ACTION payload uses the same signed BaseHash already emitted as ddsh, so the backend can reuse the existing dynamic-service linker.

Enablement

DD_DBM_PROPAGATION_MODE=dynamic_service
DD_DBM_PROPAGATION_ORACLE_ACTION_ONLY_ENABLED=true

Verification

  • ./gradlew :dd-trace-api:spotlessApply :internal-api:spotlessApply :dd-java-agent:agent-bootstrap:spotlessApply :dd-java-agent:instrumentation:jdbc:spotlessApply
  • ./gradlew :internal-api:test --tests 'datadog.trace.api.ConfigTest.Oracle DBM action propagation enabled*'
  • ./gradlew :dd-java-agent:instrumentation:jdbc:forkedTest --tests 'OracleInjectionForkedTest' --tests 'OracleDynamicServiceActionInjectionForkedTest' --tests 'DBMDynamicServiceInjectionForkedTest'

Links

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
• Patch Coverage: 80.00%
• Overall Coverage: 58.40% (-0.02%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 35692f7 | Docs | View more details | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 13.94 s 14.02 s [-1.1%; +0.1%] (no difference)
startup:insecure-bank:tracing:Agent 12.88 s 12.94 s [-1.2%; +0.2%] (no difference)
startup:petclinic:appsec:Agent 16.91 s 16.70 s [+0.4%; +2.1%] (maybe worse)
startup:petclinic:iast:Agent 16.98 s 17.01 s [-1.1%; +0.7%] (no difference)
startup:petclinic:profiling:Agent 16.81 s 16.87 s [-1.4%; +0.7%] (no difference)
startup:petclinic:sca:Agent 16.65 s 16.49 s [-0.0%; +1.9%] (no difference)
startup:petclinic:tracing:Agent 16.10 s 16.16 s [-1.2%; +0.5%] (no difference)

Commit: 35692f70 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@joelmarcotte
joelmarcotte marked this pull request as ready for review August 19, 2026 17:47
@joelmarcotte
joelmarcotte requested review from a team as code owners August 19, 2026 17:47
@joelmarcotte
joelmarcotte requested review from mhdatie and ygree and removed request for a team August 19, 2026 17:47
@dd-octo-sts

dd-octo-sts Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

@joelmarcotte joelmarcotte added comp: database Database Monitoring type: feature Enhancements and improvements inst: jdbc JDBC instrumentation tag: ai generated Largely based on code generated by an AI or LLM labels Aug 19, 2026

@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: ab2505d811

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

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Datadog Autotest: FAIL

The new Oracle ACTION path ignores the process-tag propagation opt-out. It can send a hash without the matching span tag, so DBM-to-APM correlation fails.

Open Bits AI session

🤖 Datadog Autotest · Commit ab2505d · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@dougqh dougqh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the mutable parts of DbInfo need to live elsewhere.
Please see inline comments for more details.

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Datadog Autotest: FAIL

A BaseHash update can put one hash in Oracle ACTION and a different hash on the JDBC span. This mismatch prevents DBM correlation for that query.

Open Bits AI session

🤖 Datadog Autotest · Commit c8283cb · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@joelmarcotte
joelmarcotte requested a review from a team as a code owner August 20, 2026 14:47

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Datadog Autotest: PASS

More details

The opt-in path keeps Oracle statement text unchanged. It updates ACTION when BaseHash changes and keeps mutable ACTION state per connection. No concrete failure mode clears the reporting threshold.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Datadog Autotest · Commit 35692f7 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@dougqh dougqh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me now -- thanks for doing the rework to split up DbInfo

@ygree ygree left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IDM approved with a note about tests in Groovy

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit e304fe0 into master Sep 14, 2026
589 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the joel.marcotte/sdbm-2904-oracle-action-propagation branch September 14, 2026 20:32
@github-actions github-actions Bot added this to the 1.67.0 milestone Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: database Database Monitoring inst: jdbc JDBC instrumentation tag: ai generated Largely based on code generated by an AI or LLM type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants