🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

Add missing throwable suppression on instrumentation advice - #12019

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
masterfrom
bbujon/instrumentations-suppress-throwable
Jul 22, 2026
Merged

Add missing throwable suppression on instrumentation advice#12019
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
masterfrom
bbujon/instrumentations-suppress-throwable

Conversation

@PerfectSlayer

Copy link
Copy Markdown
Collaborator

What Does This Do

This PR fixes compilation warnings about missing throwable suppression from advices.

Motivation

Apply advice development conventions and prevent exceptions from bubbling up to application code.

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@PerfectSlayer
PerfectSlayer requested a review from a team as a code owner July 21, 2026 11:20
@PerfectSlayer PerfectSlayer added the inst: others All other instrumentations label Jul 21, 2026
@PerfectSlayer
PerfectSlayer requested review from AlexeyKuznetsov-DD and removed request for a team July 21, 2026 11:20

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

This PR adds suppress = Throwable.class to ByteBuddy Advice methods across 9 concurrent instrumentation files. The change follows the correct pattern: @Advice.OnMethodEnter(suppress = Throwable.class) and @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) prevent exceptions from advice code from bubbling up to application code, which is safe and required per instrumentation development conventions. The changes are mechanically sound—all scope/state management operations (startTaskScope, endTaskScope, cancelTask) are defensive and will not corrupt application state if they encounter errors.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Datadog Autotest · Commit 3c94afd · What is Autotest? · Any feedback? Reach out in #autotest

@datadog-datadog-prod-us1-2

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Jul 21, 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.01 s 14.03 s [-0.9%; +0.6%] (no difference)
startup:insecure-bank:tracing:Agent 12.97 s 13.01 s [-1.2%; +0.6%] (no difference)
startup:petclinic:appsec:Agent 16.76 s 16.77 s [-1.3%; +1.3%] (no difference)
startup:petclinic:iast:Agent 16.86 s 16.90 s [-1.0%; +0.7%] (no difference)
startup:petclinic:profiling:Agent 16.18 s 16.19 s [-6.5%; +6.3%] (unstable)
startup:petclinic:sca:Agent 16.86 s 16.71 s [-0.3%; +2.1%] (no difference)
startup:petclinic:tracing:Agent 16.08 s 16.10 s [-1.0%; +0.8%] (no difference)

Commit: 3c94afd4 · 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.

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

LGTM.
I found one super minor issue that can be improved in follow up PR:
we have ~320 lines of:

@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)

and ~150 lines of:

@Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class)

I think it make sense to have only 1 variant (mechanical find-and-replace) to simplify future search in code base.

@PerfectSlayer

Copy link
Copy Markdown
Collaborator Author

I'll do the fix but that's a way bigger change 😅
I kept it small to ease with review but since you call it out, I'll make it and leverage your current approval 😇

@PerfectSlayer
PerfectSlayer requested review from a team as code owners July 22, 2026 06:24
@PerfectSlayer
PerfectSlayer requested review from ValentinZakharov and manuel-alvarez-alvarez and removed request for a team July 22, 2026 06:24
@pr-commenter

pr-commenter Bot commented Jul 22, 2026

Copy link
Copy Markdown

Kafka / producer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master bbujon/instrumentations-suppress-throwable
git_commit_date 1784625220 1784701303
git_commit_sha 01b5e2c b9fdb21
See matching parameters
Baseline Candidate
ci_job_date 1784702531 1784702531
ci_job_id 1881339409 1881339409
ci_pipeline_id 126153290 126153290
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
jdkVersion 11.0.25 11.0.25
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 -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/go/src/github.com/DataDog/apm-reliability/dd-trace-java/platform/src/producer-benchmark/build/tmp/jmh -Duser.country=US -Duser.language=en -Duser.variant -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/go/src/github.com/DataDog/apm-reliability/dd-trace-java/platform/src/producer-benchmark/build/tmp/jmh -Duser.country=US -Duser.language=en -Duser.variant
vmName OpenJDK 64-Bit Server VM OpenJDK 64-Bit Server VM
vmVersion 11.0.25+9-post-Ubuntu-1ubuntu122.04 11.0.25+9-post-Ubuntu-1ubuntu122.04

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 Jul 22, 2026

Copy link
Copy Markdown

Kafka / consumer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master bbujon/instrumentations-suppress-throwable
git_commit_date 1784625220 1784701303
git_commit_sha 01b5e2c b9fdb21
See matching parameters
Baseline Candidate
ci_job_date 1784702572 1784702572
ci_job_id 1881339410 1881339410
ci_pipeline_id 126153290 126153290
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
jdkVersion 11.0.25 11.0.25
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 -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/go/src/github.com/DataDog/apm-reliability/dd-trace-java/platform/src/consumer-benchmark/build/tmp/jmh -Duser.country=US -Duser.language=en -Duser.variant -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/go/src/github.com/DataDog/apm-reliability/dd-trace-java/platform/src/consumer-benchmark/build/tmp/jmh -Duser.country=US -Duser.language=en -Duser.variant
vmName OpenJDK 64-Bit Server VM OpenJDK 64-Bit Server VM
vmVersion 11.0.25+9-post-Ubuntu-1ubuntu122.04 11.0.25+9-post-Ubuntu-1ubuntu122.04

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 unsure
[-17492.041op/s; -238.320op/s] or [-5.629%; -0.077%]
scenario:only-tracing-dsm-enabled-benchmarks/KafkaConsumerBenchmark.benchConsume same

@PerfectSlayer

Copy link
Copy Markdown
Collaborator Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 22, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-22 07:46:45 UTC ℹ️ Start processing command /merge


2026-07-22 07:46:49 UTC ℹ️ MergeQueue: pull request added to the queue

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


2026-07-22 08:43:28 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit e28396a into master Jul 22, 2026
588 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the bbujon/instrumentations-suppress-throwable branch July 22, 2026 08:43
@github-actions github-actions Bot added this to the 1.65.0 milestone Jul 22, 2026

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

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: others All other instrumentations type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants