Skip to content

Remove iteration and checkpoint scope static helpers from AgentTracer - #13415

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 5 commits into
masterfrom
mcculls/remove-deprecated-instrumentation-static-methods
Nov 26, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 5 commits into
masterfrom
mcculls/remove-deprecated-instrumentation-static-methods

Conversation

@mcculls

@mcculls mcculls commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What Does This Do

Remove four static AgentTracer helpers for checkpoint rollback and iteration scopes. Existing legacy callers use the corresponding TracerAPI instance methods, which this PR deprecates.

Motivation

Make legacy scope operations explicit at call sites as instrumentation migrates to the Context API.

Additional Notes

Akka and Pekko exit advice roll back the scope stack only in legacy mode. In context-swap mode, the advice tolerates a missing saved context and still closes the actor's task scope if one was opened. The new tests call the actor and mailbox exit advice directly with a missing saved context.

The Spock harness finishes the last legacy iteration span before checking for an active span on the test thread during teardown. Setup resets that thread's context to root before the feature runs.

Review decisions

  • Iteration span cleanup. Keep closePrevious(true) before trace collection, flushing, and scope diagnostics because finishing the span can publish a trace. An exception here is expected to be rare and would point to a test or tracer issue worth investigating directly.
  • Suite setup spans. The setupSpec() fixtures that explicitly activate spans close their scopes, and the review found no fixture that leaves one active. A first-feature check would attribute a suite setup leak to that feature. If a leak is found, check for it at the suite setup boundary.
  • Deprecated helper documentation. The instance methods are temporary migration hooks. The existing group comment records their purpose.
  • Legacy checkpoint handling. Keep the mode check in the Akka and Pekko exits. Rolling back after a failed legacy checkpoint already had the same behavior, and tracking checkpoint success would add state to the legacy path being phased out.

@mcculls mcculls added tag: no release notes Changes to exclude from release notes type: refactoring comp: context propagation Trace context propagation tag: ai generated Largely based on code generated by an AI or LLM labels Nov 12, 2026
@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🎯 Code Coverage (details)
• Patch Coverage: 0.00%
• Overall Coverage: 59.62% (-1.60%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 9728ceb | Docs | Give us feedback!

@pr-commenter

pr-commenter Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Debugger benchmarks

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
ci_job_date 1794780627 1794780953
end_time 2026-11-15T22:11:55 2026-11-15T22:17:21
git_branch master mcculls/remove-deprecated-instrumentation-static-methods
git_commit_sha e8e4235 25fb576
start_time 2026-11-15T22:10:28 2026-11-15T22:15:54
See matching parameters
Baseline Candidate
ci_job_id 2255929940 2255929940
ci_pipeline_id 153369333 153369333
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
git_commit_date 1794779746 1794779746

Summary

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

See unchanged results
scenario Δ mean agg_http_req_duration_min Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p75 Δ mean agg_http_req_duration_p99 Δ mean throughput
scenario:noprobe unstable
[-28.040µs; +55.925µs] or [-8.862%; +17.675%]
unstable
[-38.099µs; +68.161µs] or [-10.855%; +19.420%]
unstable
[-47.088µs; +84.782µs] or [-12.885%; +23.199%]
unstable
[-207.789µs; +462.268µs] or [-17.573%; +39.095%]
same
scenario:basic same same same unstable
[-156.450µs; +21.726µs] or [-13.967%; +1.940%]
same
scenario:loop same same same same same
Request duration reports for reports
gantt
    title reports - request duration [CI 0.99] : candidate=None, baseline=None
    dateFormat X
    axisFormat %s
section baseline
noprobe (350.976 µs) : 318, 384
.   : milestone, 351,
basic (330.742 µs) : 326, 335
.   : milestone, 331,
loop (8.101 ms) : 8038, 8164
.   : milestone, 8101,
section candidate
noprobe (366.007 µs) : 302, 430
.   : milestone, 366,
basic (332.216 µs) : 326, 338
.   : milestone, 332,
loop (8.106 ms) : 8043, 8168
.   : milestone, 8106,
Loading
  • baseline results
Scenario Request median duration [CI 0.99]
noprobe 350.976 µs [318.428 µs, 383.525 µs]
basic 330.742 µs [326.092 µs, 335.392 µs]
loop 8.101 ms [8.038 ms, 8.164 ms]
  • candidate results
Scenario Request median duration [CI 0.99]
noprobe 366.007 µs [302.47 µs, 429.544 µs]
basic 332.216 µs [326.476 µs, 337.956 µs]
loop 8.106 ms [8.043 ms, 8.168 ms]

@dd-octo-sts

dd-octo-sts Bot commented Nov 12, 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 14.82 s 14.68 s [+0.1%; +1.9%] (maybe worse)
startup:insecure-bank:tracing:Agent 13.69 s 13.75 s [-1.3%; +0.5%] (no difference)
startup:petclinic:appsec:Agent 17.71 s 17.68 s [-0.7%; +1.1%] (no difference)
startup:petclinic:iast:Agent 17.50 s 17.66 s [-1.7%; -0.0%] (maybe better)
startup:petclinic:profiling:Agent 17.36 s 17.34 s [-1.1%; +1.4%] (no difference)
startup:petclinic:sca:Agent 17.30 s 17.71 s [-6.5%; +1.9%] (no difference)
startup:petclinic:tracing:Agent 16.80 s 16.88 s [-1.4%; +0.4%] (no difference)

Commit: 9728ceb0 · 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.

@mcculls mcculls changed the title Restrict legacy scope operations to tracer instances Remove static iteration and checkpoint scope helpers from AgentTracer Nov 12, 2026
@mcculls mcculls changed the title Remove static iteration and checkpoint scope helpers from AgentTracer Remove iteration and checkpoint scope static helpers from AgentTracer Nov 12, 2026
@mcculls
mcculls added this pull request to stack #13397 November 12, 2026 18:16
@pr-commenter

pr-commenter Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Kafka / producer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mcculls/remove-deprecated-instrumentation-static-methods
git_commit_date 1795636758 1795636767
git_commit_sha bd4b33a 9728ceb
See matching parameters
Baseline Candidate
ci_job_date 1795637880 1795637880
ci_job_id 2302702682 2302702682
ci_pipeline_id 156575950 156575950
cpu_model Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz
jdkVersion 11.0.31 11.0.31
jmhVersion 1.36 1.36
jvm /usr/lib/jvm/java-11-openjdk-amd64/bin/java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
jvmArgs -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=15002 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=15002 -Dhttp.nonProxyHosts=localhost *.localhost
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-f5fn6fs3 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-f5fn6fs3 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
vmName OpenJDK 64-Bit Server VM OpenJDK 64-Bit Server VM
vmVersion 11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu 11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu

Summary

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

See unchanged results
scenario Δ mean throughput
scenario:not-instrumented/KafkaProduceBenchmark.benchProduce same
scenario:only-tracing-dsm-disabled-benchmarks/KafkaProduceBenchmark.benchProduce same
scenario:only-tracing-dsm-enabled-benchmarks/KafkaProduceBenchmark.benchProduce same

@pr-commenter

pr-commenter Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Kafka / consumer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mcculls/remove-deprecated-instrumentation-static-methods
git_commit_date 1795636758 1795636767
git_commit_sha bd4b33a 9728ceb
See matching parameters
Baseline Candidate
ci_job_date 1795637918 1795637918
ci_job_id 2302702684 2302702684
ci_pipeline_id 156575950 156575950
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
jdkVersion 11.0.31 11.0.31
jmhVersion 1.36 1.36
jvm /usr/lib/jvm/java-11-openjdk-amd64/bin/java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
jvmArgs -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=15002 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=15002 -Dhttp.nonProxyHosts=localhost *.localhost
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-ux0zv2ce 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-ux0zv2ce 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
vmName OpenJDK 64-Bit Server VM OpenJDK 64-Bit Server VM
vmVersion 11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu 11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu

Summary

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

See unchanged results
scenario Δ mean throughput
scenario:not-instrumented/KafkaConsumerBenchmark.benchConsume same
scenario:only-tracing-dsm-disabled-benchmarks/KafkaConsumerBenchmark.benchConsume same
scenario:only-tracing-dsm-enabled-benchmarks/KafkaConsumerBenchmark.benchConsume same

@mcculls
mcculls force-pushed the mcculls/remove-deprecated-instrumentation-static-methods branch 3 times, most recently from c5d6981 to 31368e7 Compare November 13, 2026 00:03
@mcculls
mcculls force-pushed the mcculls/remove-deprecated-instrumentation-static-methods branch from 31368e7 to 9df6fff Compare November 14, 2026 20:18
@mcculls
mcculls force-pushed the mcculls/remove-deprecated-instrumentation-static-methods branch from 9df6fff to d0f7c17 Compare November 15, 2026 21:01
@mcculls
mcculls force-pushed the mcculls/remove-deprecated-instrumentation-static-methods branch from d0f7c17 to 25fb576 Compare November 15, 2026 21:59
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot force-pushed the mcculls/remove-deprecated-instrumentation-static-methods branch from 25fb576 to f0cca70 Compare November 16, 2026 16:59
@mcculls
mcculls force-pushed the mcculls/remove-deprecated-instrumentation-static-methods branch from f0cca70 to 750252b Compare November 16, 2026 23:56
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot force-pushed the mcculls/remove-deprecated-instrumentation-static-methods branch 2 times, most recently from ef423ba to 48d0ce2 Compare November 18, 2026 18:08
@mcculls
mcculls force-pushed the mcculls/remove-deprecated-instrumentation-static-methods branch from 48d0ce2 to 8fbceed Compare November 18, 2026 19:48
@mcculls
mcculls requested review from a team as code owners November 24, 2026 19:07
@mcculls
mcculls requested review from AlexeyKuznetsov-DD, ValentinZakharov and mabdinur and removed request for a team November 24, 2026 19:07
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T19:09:21.958546Z 81dd140 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@mcculls
mcculls requested a review from amarziali November 24, 2026 19:07

@datadog-prod-us1-6 datadog-prod-us1-6 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.

Bits Code Review: PASS

More details

Akka and Pekko exits preserve legacy rollback while allowing actor task scopes to close when context-swap entry leaves no saved context. The static reviewer reported no actionable regressions.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 81dd140

Base automatically changed from mcculls/context-capture-callers to master November 25, 2026 19:59
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot requested a review from a team as a code owner November 25, 2026 19:59
… scope operations

Require explicit access through AgentTracer.get() to discourage their use while retaining
TracerAPI support for legacy code paths. Update instrumentations and test support to use
the instance methods.
Restore each test's configuration before checking the context manager mode,
and only close lingering iteration scopes when legacy mode is enabled.
Check the context manager mode before rolling back scopes in actor and mailbox exit advice.
In context-swap mode, tolerate a missing saved context after a suppressed entry failure and
still close the actor task scope. Add regression tests for both frameworks.
Finish lingering legacy iteration spans and check for remaining active spans in the test that created them.
Reset context to root during setup so a failed test does not carry its active context into the next test.
Preserve existing scope diagnostics and failure aggregation.
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot force-pushed the mcculls/remove-deprecated-instrumentation-static-methods branch from 81dd140 to 9728ceb Compare November 25, 2026 19:59

@datadog-prod-us1-6 datadog-prod-us1-6 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.

Bits Code Review: PASS

More details

Akka and Pekko exits preserve legacy rollback and tolerate missing saved contexts during context-swap cleanup. The completed static review found no reportable defects.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 9728ceb

@mcculls

mcculls commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-11-26 16:26:49 UTC ℹ️ Start processing command /merge


2026-11-26 16:26:54 UTC ℹ️ MergeQueue: pull request added to the queue

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


2026-11-26 17:19:57 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 6fbb6f8 into master Nov 26, 2026
916 of 918 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the mcculls/remove-deprecated-instrumentation-static-methods branch November 26, 2026 17:19
@github-actions github-actions Bot added this to the 1.70.0 milestone Nov 26, 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 tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants