Skip to content

Remove redundant null checks in rxjava2 instrumentation (current Context is never null)#11875

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
mcculls/cleanup-rxjava2-context
Jul 9, 2026
Merged

Remove redundant null checks in rxjava2 instrumentation (current Context is never null)#11875
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
mcculls/cleanup-rxjava2-context

Conversation

@mcculls

@mcculls mcculls commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Motivation

Simpler code, avoids unnecessarily storing root context - now matches the rxjava 3 instrumentation.

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]

@mcculls mcculls added inst: others All other instrumentations tag: no release notes Changes to exclude from release notes type: refactoring labels Jul 7, 2026
@mcculls mcculls marked this pull request as ready for review July 7, 2026 11:11
@mcculls mcculls requested a review from a team as a code owner July 7, 2026 11:11
@mcculls mcculls requested review from ValentinZakharov and removed request for a team July 7, 2026 11:11
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 69.73% (+12.80%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 7ec48b4 | Docs | Datadog PR Page | Give us feedback!

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

Looking good. Thanks for the follow up changes

@PerfectSlayer PerfectSlayer added the tag: concurrency Virtual Threads, Coroutines, Async, RX, Executors label Jul 7, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jul 7, 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.96 s 13.92 s [-0.4%; +0.9%] (no difference)
startup:insecure-bank:tracing:Agent 12.93 s 13.01 s [-1.4%; +0.1%] (no difference)
startup:petclinic:appsec:Agent 16.88 s 16.62 s [+0.4%; +2.7%] (maybe worse)
startup:petclinic:iast:Agent 16.77 s 16.49 s [-2.8%; +6.2%] (no difference)
startup:petclinic:profiling:Agent 16.78 s 16.84 s [-1.7%; +1.0%] (no difference)
startup:petclinic:sca:Agent 16.87 s 16.72 s [-0.3%; +2.1%] (no difference)
startup:petclinic:tracing:Agent 16.06 s 16.07 s [-1.0%; +0.8%] (no difference)

Commit: 7ec48b4a · 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-rxjava2-context branch from fcbb916 to 0f72563 Compare July 7, 2026 14:38
@pr-commenter

pr-commenter Bot commented Jul 7, 2026

Copy link
Copy Markdown

Kafka / producer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch mcculls/cleanup-java8-bridge mcculls/cleanup-rxjava2-context
git_commit_date 1783434996 1783435050
git_commit_sha 291064f 0f72563
See matching parameters
Baseline Candidate
ci_job_date 1783436298 1783436298
ci_job_id 1837454066 1837454066
ci_pipeline_id 123279465 123279465
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 unsure
[-4582.157op/s; -398.459op/s] or [-3.142%; -0.273%]

@mcculls mcculls force-pushed the mcculls/cleanup-java8-bridge branch from 291064f to 89f8653 Compare July 8, 2026 21:54
@mcculls mcculls requested review from a team as code owners July 8, 2026 21:54
@mcculls mcculls requested review from amarziali and mtoffl01 and removed request for a team July 8, 2026 21:54
@mcculls mcculls force-pushed the mcculls/cleanup-rxjava2-context branch from 0f72563 to 1f238e0 Compare July 8, 2026 22:16
@pr-commenter

pr-commenter Bot commented Jul 8, 2026

Copy link
Copy Markdown

Kafka / consumer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch mcculls/cleanup-java8-bridge mcculls/cleanup-rxjava2-context
git_commit_date 1783547398 1783548974
git_commit_sha 89f8653 1f238e0
See matching parameters
Baseline Candidate
ci_job_date 1783550128 1783550128
ci_job_id 1843705532 1843705532
ci_pipeline_id 123661065 123661065
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 unsure
[-8356.424op/s; -752.697op/s] or [-2.820%; -0.254%]
scenario:only-tracing-dsm-disabled-benchmarks/KafkaConsumerBenchmark.benchConsume same
scenario:only-tracing-dsm-enabled-benchmarks/KafkaConsumerBenchmark.benchConsume same

Base automatically changed from mcculls/cleanup-java8-bridge to master July 9, 2026 00:02
@mcculls mcculls force-pushed the mcculls/cleanup-rxjava2-context branch from 1f238e0 to 7ec48b4 Compare July 9, 2026 01:03
@mcculls mcculls enabled auto-merge July 9, 2026 01:04

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

thanks. there are probably others to clean up elsewhere

@mcculls mcculls added this pull request to the merge queue Jul 9, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

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

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-09 08:00:33 UTC ℹ️ Start processing command /merge


2026-07-09 08:00:39 UTC ℹ️ MergeQueue: pull request added to the queue

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


2026-07-09 08:58:31 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 Jul 9, 2026
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit bee92a4 into master Jul 9, 2026
587 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the mcculls/cleanup-rxjava2-context branch July 9, 2026 08:58
@github-actions github-actions Bot added this to the 1.65.0 milestone Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: others All other instrumentations tag: concurrency Virtual Threads, Coroutines, Async, RX, Executors 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.

3 participants