Skip to content

Cleanup Java8BytecodeBridge and align it more with OTel#11857

Open
mcculls wants to merge 3 commits into
masterfrom
mcculls/cleanup-java8-bridge
Open

Cleanup Java8BytecodeBridge and align it more with OTel#11857
mcculls wants to merge 3 commits into
masterfrom
mcculls/cleanup-java8-bridge

Conversation

@mcculls

@mcculls mcculls commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

  • added static imports for all method calls
  • dropped the get prefix from context methods
  • added currentSpan method
  • added baggageFromContext method
  • pruned unused methods (may add them back later, but only when needed)

Motivation

Consistency with https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/javaagent-extension-api/src/main/java/io/opentelemetry/javaagent/bootstrap/Java8BytecodeBridge.java#L22

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: [PROJ-IDENT]

 * added static imports for all method calls
 * dropped the `get` prefix from context methods
 * added `currentSpan` method
 * added `baggageFromContext` method
 * pruned unused methods (may add them back later if/when needed)
@mcculls mcculls added comp: core Tracer core tag: no release notes Changes to exclude from release notes type: refactoring labels Jul 3, 2026
@mcculls mcculls requested review from a team as code owners July 3, 2026 19:56
@mcculls mcculls requested review from PerfectSlayer, dougqh, jordan-wong, mtoffl01 and sarahchen6 and removed request for a team July 3, 2026 19:56

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2691b55fd1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

* @see Context#current()
*/
public static Context getCurrentContext() {
public static Context currentContext() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update remaining RxJava3 bridge callers

This rename removes getCurrentContext()/getRootContext(), but a repo-wide search still finds the RxJava3 instrumentations calling Java8BytecodeBridge.getCurrentContext() and Java8BytecodeBridge.getRootContext() under dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java. Those main sources will no longer compile against this updated bridge, so either keep compatibility aliases or update the RxJava3 callers as well.

Useful? React with 👍 / 👎.

@datadog-prod-us1-5

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Jul 3, 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.93 s 14.01 s [-1.2%; -0.0%] (maybe better)
startup:insecure-bank:tracing:Agent 12.92 s 13.03 s [-1.5%; -0.1%] (maybe better)
startup:petclinic:appsec:Agent 16.98 s 16.75 s [+0.5%; +2.2%] (maybe worse)
startup:petclinic:iast:Agent 16.88 s 17.05 s [-1.7%; -0.4%] (maybe better)
startup:petclinic:profiling:Agent 16.89 s 16.76 s [-0.3%; +1.9%] (no difference)
startup:petclinic:sca:Agent 16.91 s 16.75 s [+0.1%; +1.8%] (maybe worse)
startup:petclinic:tracing:Agent 16.04 s 16.34 s [-2.8%; -0.9%] (maybe better)

Commit: 62c8c9ba · 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 force-pushed the mcculls/cleanup-java8-bridge branch from 0aed531 to 62c8c9b Compare July 3, 2026 22:46
@pr-commenter

pr-commenter Bot commented Jul 3, 2026

Copy link
Copy Markdown

Kafka / producer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mcculls/cleanup-java8-bridge
git_commit_date 1783099974 1783118767
git_commit_sha 2068d0d 62c8c9b
See matching parameters
Baseline Candidate
ci_job_date 1783119868 1783119868
ci_job_id 1829300369 1829300369
ci_pipeline_id 122656548 122656548
cpu_model Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8175M 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 3, 2026

Copy link
Copy Markdown

Kafka / consumer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mcculls/cleanup-java8-bridge
git_commit_date 1783099974 1783118767
git_commit_sha 2068d0d 62c8c9b
See matching parameters
Baseline Candidate
ci_job_date 1783119825 1783119825
ci_job_id 1829300371 1829300371
ci_pipeline_id 122656548 122656548
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 same
scenario:only-tracing-dsm-enabled-benchmarks/KafkaConsumerBenchmark.benchConsume same

@mhlidd mhlidd 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 following a fix to the new RxJava3 instrumentation

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

Labels

comp: core Tracer core 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