Skip to content

Implement an Org Propagation Guard mechanism#11289

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 7 commits into
masterfrom
andrea.marziali/opg2
Jun 3, 2026
Merged

Implement an Org Propagation Guard mechanism#11289
gh-worker-dd-mergequeue-cf854d[bot] merged 7 commits into
masterfrom
andrea.marziali/opg2

Conversation

@amarziali

@amarziali amarziali commented May 6, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

Adds the Org Propagation Guard (OPG): a propagation-layer check that prevents the part of the tracing context from leaking across organizational boundaries.

When enabled, every inbound trace is checked against the local Org Propagation Marker (OPM) reported by the Datadog Agent. If the inbound OPM doesn't match (or is absent in strict mode), sampling priority, origin, and _dd.p.* propagation tags are dropped. Parent/trace IDs, W3C baggage, and non-dd vendor tracestate are kept. On the inject side, the local OPM is stamped onto outgoing requests so downstream services can do the same check.

Off by default, with no overhead when disabled. When the agent hasn't reported a local OPM yet, enforcement is skipped entirely and the inbound context passes through unchanged, including any inbound OPM it carries.

Two additional knobs:

  • DD_TRACE_ORG_GUARD_STRICT=true also enforces when the inbound OPM is absent (not just on mismatch)
  • DD_TRACE_ORG_GUARD_TRUSTED_OPMS accepts a comma-separated list of partner OPMs to allow through

Each enforcement emits an org_guard.enforce metric with a reason tag (mismatch or strict_missing).

New configuration

Env var Default Description
DD_TRACE_ORG_GUARD_ENABLED false Master switch
DD_TRACE_ORG_GUARD_STRICT false Enforce when inbound OPM is absent too
DD_TRACE_ORG_GUARD_TRUSTED_OPMS (empty) Comma-separated allowlist of trusted inbound OPMs

Motivation

Additional Notes

System tests: DataDog/system-tests#6872

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: feature Enhancements and improvements comp: context propagation Trace context propagation labels May 6, 2026
@amarziali amarziali force-pushed the andrea.marziali/opg2 branch from 36a2d96 to 58d4e2d Compare May 26, 2026 09:42
@datadog-prod-us1-5

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

Copy link
Copy Markdown
Contributor

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 5 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-java | java-startup-parallel-check-slo-breaches   View in Datadog   GitLab

See error Failed to retrieve GitHub token due to missing file 'artifacts/fail-on-breach.github-token'. No Markdown threshold comparison report generated.

DataDog/apm-reliability/dd-trace-java | java-startup-parallel-generate-slos   View in Datadog   GitLab

See error Script execution failed. No artifacts found in working directory or CI project directory.

DataDog/apm-reliability/dd-trace-java | java-startup-parallel-upload-to-bp-api   View in Datadog   GitLab

See error File check failed: cannot access '/go/src/github.com/DataDog/apm-reliability/dd-trace-java/artifacts/candidate-*.converted.json'

View all 5 failed jobs.

Useful? React with 👍 / 👎

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

@dd-octo-sts

dd-octo-sts Bot commented May 26, 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

Startup Time

Scenario This PR master Change
insecure-bank / iast 13,995 ms 13,870 ms +0.9%
insecure-bank / tracing 12,852 ms 12,951 ms -0.8%
petclinic / appsec 16,519 ms 16,478 ms +0.2%
petclinic / iast 16,598 ms 16,606 ms -0.0%
petclinic / profiling 16,356 ms 16,545 ms -1.1%
petclinic / tracing 15,892 ms 15,793 ms +0.6%

Commit: 58d4e2d8 · 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.

@amarziali amarziali force-pushed the andrea.marziali/opg2 branch from 58d4e2d to 784f890 Compare June 2, 2026 07:04
@amarziali amarziali marked this pull request as ready for review June 2, 2026 07:29
@amarziali amarziali requested review from a team as code owners June 2, 2026 07:29
@amarziali amarziali requested review from manuel-alvarez-alvarez, mcculls, mtoffl01 and sarahchen6 and removed request for a team June 2, 2026 07:29

@mcculls mcculls 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 - just some small suggestions

@amarziali amarziali force-pushed the andrea.marziali/opg2 branch from 64ce55d to 92cf0c6 Compare June 3, 2026 07:19
@amarziali amarziali enabled auto-merge June 3, 2026 07:20
@amarziali amarziali force-pushed the andrea.marziali/opg2 branch from 92cf0c6 to 696dadc Compare June 3, 2026 08:18
@amarziali amarziali added this pull request to the merge queue Jun 3, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

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

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-06-03 09:50:08 UTC ℹ️ Start processing command /merge


2026-06-03 09:50:13 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-06-03 11:50:50 UTCMergeQueue: The build pipeline has timeout

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

@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 3, 2026
@amarziali

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

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

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-06-03 12:17:44 UTC ℹ️ Start processing command /merge


2026-06-03 12:17:49 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-06-03 13:33:40 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit da34f3a into master Jun 3, 2026
756 of 760 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the andrea.marziali/opg2 branch June 3, 2026 13:33
@github-actions github-actions Bot added this to the 1.64.0 milestone Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: context propagation Trace context propagation type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants