Skip to content

Bump Guava to 33.6.0-jre and drop redundant usage#11722

Open
AlexeyKuznetsov-DD wants to merge 10 commits into
masterfrom
alexeyk/bump-and-clean-guava
Open

Bump Guava to 33.6.0-jre and drop redundant usage#11722
AlexeyKuznetsov-DD wants to merge 10 commits into
masterfrom
alexeyk/bump-and-clean-guava

Conversation

@AlexeyKuznetsov-DD

Copy link
Copy Markdown
Contributor

What Does This Do

Bumps Guava from the legacy [16.0,20.0] range (pinned for Java 7) to 33.6.0-jre (April 14) and cleans up obvious places where Guava was used for things available out-of-the-box in the JDK:

  • Replaces com.google.common.base.Charsets.UTF_8 with java.nio.charset.StandardCharsets.UTF_8.
  • Replaces Iterables.unmodifiableIterable(...) with a plain Iterable.
  • Drops the unused testImplementation(libs.guava) from dd-trace-api, agent-iast, and correlation-id-injection.
  • Pins Guava back for two instrumentation test sets that link against APIs removed in newer Guava:
    • dropwizard-0.8 → forced to 25.1-jre (Jackson's FuzzyEnumModule references CharMatcher.WHITESPACE).
    • grizzly-2.0 → forced to 20.0 (Jersey 2.0 links to the removed MoreExecutors.sameThreadExecutor).
  • Regenerates the affected gradle.lockfiles.

Motivation

The Guava version was still pinned to a 2016-era range for Java 7 compatibility, which is long obsolete. Bumping to the latest -jre release keeps us current on security/bug fixes, and removing trivial Guava usages reduces our reliance on the library where the JDK already provides equivalents.

Additional Notes

Guava used only in test scope.

See releases for the guava changes.

# Conflicts:
#	gradle/libs.versions.toml
# Conflicts:
#	dd-java-agent/instrumentation/glassfish-3.0/gradle.lockfile
#	dd-java-agent/instrumentation/grizzly/grizzly-2.0/gradle.lockfile
#	dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/gradle.lockfile
#	dd-java-agent/instrumentation/kafka/kafka-clients-0.11/gradle.lockfile
#	dd-java-agent/instrumentation/kafka/kafka-clients-3.8/gradle.lockfile
#	dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-2.0/gradle.lockfile
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD self-assigned this Jun 24, 2026
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD added tag: no release notes Changes to exclude from release notes type: refactoring tag: dependencies Dependencies related changes labels Jun 24, 2026
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD marked this pull request as ready for review June 24, 2026 00:12
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD requested review from a team as code owners June 24, 2026 00:12
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD requested review from claponcet, manuel-alvarez-alvarez, mhlidd and ygree and removed request for a team June 24, 2026 00:12

@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: b1dd56229e

ℹ️ 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".

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

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread gradle/libs.versions.toml

@datadog-prod-us1-5 datadog-prod-us1-5 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: FAIL

The PR replaces Iterables.unmodifiableIterable(wrapped) with wrapped.&iterator in ObjectVisitorTest, but this change breaks the test. A Groovy method reference (.&iterator) creates a Closure, which does NOT implement Iterable. When ObjectVisitor checks instanceof Iterable, the Closure fails the check and is processed as a regular object, causing the expected visitor calls to never occur.

View proposed fix
📊 Validated against 1 scenarios · Open Bits AI session

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

final visitor = Mock(ObjectVisitor.Visitor)
final wrapped = ['1', '2', '3']
final target = Iterables.unmodifiableIterable(wrapped)
final Iterable target = wrapped.&iterator

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.

P0 Test semantic failure: wrapped.&iterator is not an Iterable

Test failure that prevents the build from passing and blocks the Guava bump PR.

Assertion details
  • Input: Test visiting iterable with ObjectVisitor where target is wrapped.&iterator (a Groovy method reference/closure)
  • Expected: ObjectVisitor should treat the target as an Iterable and call visitor.visit() for each element: root[0], root[1], root[2]
  • Actual: wrapped.&iterator creates a Closure which does NOT implement Iterable. ObjectVisitor checks instanceof Iterable at line 83, which fails for Closure. The object is then processed via visitObject() instead of visitIterable(), and since the predicate Iterable.isAssignableFrom(Closure.class) is false, no elements are visited. Test mock expectations (lines 48-50) expect 3 visitor calls but will get 0 or 1, causing test failure.

Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · Any feedback? Reach out in #autotest

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This one is actually a false-positive - test passed.
But to make things more obvious applied cosmetic fix in b05db2ea

@dd-octo-sts

dd-octo-sts Bot commented Jun 24, 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.95 s 13.95 s [-0.7%; +0.8%] (no difference)
startup:insecure-bank:tracing:Agent 12.92 s 12.99 s [-1.3%; +0.2%] (no difference)
startup:petclinic:appsec:Agent 16.71 s 16.67 s [-1.0%; +1.5%] (no difference)
startup:petclinic:iast:Agent 16.83 s 16.85 s [-0.9%; +0.7%] (no difference)
startup:petclinic:profiling:Agent 16.18 s 16.88 s [-8.3%; -0.0%] (maybe better)
startup:petclinic:sca:Agent 16.89 s 16.61 s [+0.7%; +2.7%] (maybe worse)
startup:petclinic:tracing:Agent 16.08 s 15.54 s [-0.6%; +7.7%] (no difference)

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

@pr-commenter

pr-commenter Bot commented Jun 24, 2026

Copy link
Copy Markdown

Kafka / producer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master alexeyk/bump-and-clean-guava
git_commit_date 1782256368 1782261487
git_commit_sha 11646d3 b05db2e
See matching parameters
Baseline Candidate
ci_job_date 1782262627 1782262627
ci_job_id 1798357145 1798357145
ci_pipeline_id 120648220 120648220
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 Jun 24, 2026

Copy link
Copy Markdown

Kafka / consumer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master alexeyk/bump-and-clean-guava
git_commit_date 1782256368 1782261487
git_commit_sha 11646d3 b05db2e
See matching parameters
Baseline Candidate
ci_job_date 1782262588 1782262588
ci_job_id 1798357146 1798357146
ci_pipeline_id 120648220 120648220
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 1 performance regressions! Performance is the same for 2 metrics, 0 unstable metrics.

scenario Δ mean throughput
scenario:only-tracing-dsm-disabled-benchmarks/KafkaConsumerBenchmark.benchConsume worse
[-14118.261op/s; -3143.594op/s] or [-4.588%; -1.022%]
See unchanged results
scenario Δ mean throughput
scenario:not-instrumented/KafkaConsumerBenchmark.benchConsume same
scenario:only-tracing-dsm-enabled-benchmarks/KafkaConsumerBenchmark.benchConsume same

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

Labels

tag: dependencies Dependencies related changes 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