Skip to content

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

Draft
mcculls wants to merge 5 commits into
mcculls/context-capture-callersfrom
mcculls/remove-deprecated-instrumentation-static-methods
Draft

mcculls wants to merge 5 commits into
mcculls/context-capture-callersfrom
mcculls/remove-deprecated-instrumentation-static-methods

Conversation

@mcculls

@mcculls mcculls commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What Does This Do

Remove the static checkpoint and iteration-scope helpers from AgentTracer, requiring explicit tracer-instance access for the existing legacy paths. Group and deprecate the remaining scope APIs in preparation for migration.

Motivation

Make legacy scope operations less convenient to adopt while preserving compatibility with the existing legacy context-manager paths.

Additional Notes

Akka/Pekko exit advice explicitly checks legacy mode before rollback and tolerates a missing saved context after suppressed entry failures. Regression tests cover actor task-scope closure and mailbox cleanup.

The Spock harness finishes lingering legacy iteration spans and checks for active spans during teardown, attributing leaks to the test that created them. Setup resets the context to root to isolate following tests; existing scope diagnostics remain enabled.

@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: 100.00%
• Overall Coverage: 40.38% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 750252b | 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.86 s 14.68 s [+0.3%; +2.1%] (maybe worse)
startup:insecure-bank:tracing:Agent 13.59 s 13.74 s [-1.8%; -0.4%] (maybe better)
startup:petclinic:appsec:Agent 17.79 s 17.05 s [-0.2%; +8.9%] (no difference)
startup:petclinic:iast:Agent 17.51 s 17.70 s [-2.0%; -0.2%] (maybe better)
startup:petclinic:profiling:Agent 17.31 s 17.34 s [-1.5%; +1.1%] (no difference)
startup:petclinic:sca:Agent 17.69 s 17.73 s [-1.2%; +0.8%] (no difference)
startup:petclinic:tracing:Agent 16.62 s 16.85 s [-2.5%; -0.3%] (maybe better)

Commit: f0cca70a · 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 mcculls/context-capture-callers mcculls/remove-deprecated-instrumentation-static-methods
git_commit_date 1794848385 1794848386
git_commit_sha 9721043 f0cca70
See matching parameters
Baseline Candidate
ci_job_date 1794849483 1794849483
ci_job_id 2259427889 2259427889
ci_pipeline_id 153597977 153597977
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-5s8otwoc 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-5s8otwoc 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 unsure
[+909.379op/s; +4700.013op/s] or [+0.547%; +2.826%]
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 mcculls/context-capture-callers mcculls/remove-deprecated-instrumentation-static-methods
git_commit_date 1794848385 1794848386
git_commit_sha 9721043 f0cca70
See matching parameters
Baseline Candidate
ci_job_date 1794849546 1794849546
ci_job_id 2259427892 2259427892
ci_pipeline_id 153597977 153597977
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-6tpwlje4 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-6tpwlje4 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 unsure
[+1512.310op/s; +7956.137op/s] or [+0.938%; +4.933%]

@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
… 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.
@mcculls
mcculls force-pushed the mcculls/remove-deprecated-instrumentation-static-methods branch from f0cca70 to 750252b Compare November 16, 2026 23:56

This branch has not been deployed

No deployments
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.

1 participant