Skip to content

Translate a sampling.priority tag set to a positive value to forceKeep#11621

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
mcculls/allow-sampling.priority-tag-to-force-keep
Jun 10, 2026
Merged

Translate a sampling.priority tag set to a positive value to forceKeep#11621
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
mcculls/allow-sampling.priority-tag-to-force-keep

Conversation

@mcculls

@mcculls mcculls commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

Translate a sampling.priority tag set to a positive value to forceKeep, overriding any locked sampling priority

Motivation

Since 1.34.0 sampling.priority tags were translated to setSamplingPriority but this won't override a previously locked sampling decision. When the sampling.priority tag has a positive value we now translate that to forceKeep to ensure the trace segment is kept regardless of any previous sampling decision.

Contributor Checklist

  • Format the title according to the contribution guidelines
  • Assign the type: and (comp: or inst:) labels in addition to any other useful labels
  • Avoid using close, fix, or any linking keywords when referencing an issue
    Use solves instead, and assign the PR milestone to the issue
  • Update the CODEOWNERS file on source file addition, migration, or deletion
  • Update public documentation with any new configuration flags or behaviors
  • Add your completed PR to the merge queue by commenting /merge. You can also:
    • Customize the commit message associated with the merge with /merge --commit-message "..."
    • Remove your PR from the merge queue with /merge -c
    • Skip all merge queue checks with /merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-level (note: the PR still needs to be mergeable, this will only skip the pre-merge build)
    • Get more information in this doc

Jira ticket: APMS-19721

@mcculls mcculls requested a review from dougqh June 10, 2026 15:34
@datadog-datadog-prod-us1

This comment has been minimized.

@mcculls mcculls added the tag: breaking change Breaking changes label Jun 10, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jun 10, 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.98 s 13.90 s [-0.1%; +1.2%] (no difference)
startup:insecure-bank:tracing:Agent 12.93 s 12.95 s [-0.8%; +0.5%] (no difference)
startup:petclinic:appsec:Agent 16.28 s 16.80 s [-7.4%; +1.2%] (no difference)
startup:petclinic:iast:Agent 16.28 s 16.86 s [-7.7%; +0.8%] (no difference)
startup:petclinic:profiling:Agent 16.77 s 16.77 s [-0.9%; +1.0%] (no difference)
startup:petclinic:sca:Agent 16.83 s 16.72 s [-0.4%; +1.7%] (no difference)
startup:petclinic:tracing:Agent 15.64 s 16.02 s [-6.5%; +1.8%] (no difference)

Commit: 6e7ee5c3 · 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.

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

[Claude Code review]

The fix looks correct — routing positive sampling.priority values through forceKeep() instead of setSamplingPriority() is the right approach and makes it consistent with how manual.keep already behaves.

However, there is no test covering the specific regression case this PR is meant to fix. Please add a test to TagInterceptorTest (or equivalent) that pins the following scenario:

  1. Create a span with a propagated USER_DROP context (simulating upstream inheritance of x-datadog-sampling-priority: -1)
  2. Confirm the sampling priority is locked at -1
  3. Call setTag("sampling.priority", 2) (i.e. a positive value)
  4. Assert that forceKeep is now true and the span would be kept

Without this, the exact silent-failure case from the original bug is not pinned and could regress undetected.

@mcculls

mcculls commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Test is coming - that's why this is still in draft ;)

@mcculls mcculls force-pushed the mcculls/allow-sampling.priority-tag-to-force-keep branch 3 times, most recently from 616060b to 459bc4b Compare June 10, 2026 16:51
@mcculls mcculls force-pushed the mcculls/allow-sampling.priority-tag-to-force-keep branch from 459bc4b to 6e7ee5c Compare June 10, 2026 16:52
@mcculls mcculls marked this pull request as ready for review June 10, 2026 16:52
@mcculls mcculls requested a review from a team as a code owner June 10, 2026 16:52
@mcculls mcculls enabled auto-merge June 10, 2026 20:11
@mcculls mcculls added this pull request to the merge queue Jun 10, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

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

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-06-10 20:14:13 UTC ℹ️ Start processing command /merge


2026-06-10 20:14:18 UTC ℹ️ MergeQueue: pull request added to the queue

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


2026-06-10 21:18:10 UTC ℹ️ MergeQueue: This merge request was merged

@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 10, 2026
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit fd3ed8b into master Jun 10, 2026
759 of 765 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the mcculls/allow-sampling.priority-tag-to-force-keep branch June 10, 2026 21:18
@github-actions github-actions Bot added this to the 1.64.0 milestone Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants